#include<bits/stdc++.h>
using namespace std;
template <typename T>void read(T &x){
    int f=1;x=0;char c=getchar();
    for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    x*=f;
}
const int maxn=1e5+5;
int n,num[maxn],c[maxn];

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    read(n);int x;
    for(int i=1;i<=n;i++){
        read(x);
        num[x]++;
    }
    for(int i=1;i<=n;i++){
        c[i]=c[i-1]+num[i]-min(c[i-1],num[i]);
    }
    printf("%d\n",c[n]);
    return 0;
}
